#include <iostream>
#include <Eigen/Eigen>

int main()
{
    Eigen::MatrixXd m(2, 2);
    m(0,0) = 3;
    m(0,1) = -1;
    m(1,0) = 2.5;
    m(1,1) = m(1,0) + m(0,1);
    std::cout << m << "\n";
    Eigen::RowVectorXd v(3);
    v << 1, 2, 3;
    std::cout <<"V: \n" << v << "\n";

    Eigen::RowVectorXd vec1(3);
    vec1 << 1, 2, 3;
    std::cout << "vec1 = " << vec1 << std::endl;
    
    Eigen::RowVectorXd vec2(4);
    vec2 << 1, 4, 9, 16;
    std::cout << "vec2 = " << vec2 << std::endl;
    
    Eigen::RowVectorXd joined(7);
    joined << vec1, vec2;
    std::cout << "joined = " << joined << std::endl;

    Eigen::Vector3d v1(1,2,3);
    Eigen::Vector3d w(0,1,2);
    std::cout << "Dot product: " << v1.dot(w) << std::endl;//向量点乘
    std::cout << "Cross product:\n" << v1.cross(w) << std::endl;//向量叉乘
    
    return 0;
}